﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Atom.dao.Model;
using Atom.NetFrame;

namespace Atom.biz
{
    public interface IUserBiz
    {
        /// <summary>
        /// 创建召唤师
        /// </summary>
        /// <param name="ut"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        bool Create(UserToken ut,string name);

        /// <summary>
        /// 根据链接的用户对象获取角色信息
        /// </summary>
        /// <param name="ut"></param>
        /// <returns></returns>
        UserMode GetUser(UserToken ut);

        /// <summary>
        /// 根据用户ID得到角色信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        UserMode GetUser(int id);

        /// <summary>
        /// 通过用户ID得到角色信息，每个客户端有且只调用一次，在获得INFO时调用
        /// </summary>
        /// <param name="ut"></param>
        /// <returns></returns>
        UserMode GetUserOnGetInfo(UserToken ut);

        /// <summary>
        /// 角色上线
        /// </summary>
        /// <param name="ut"></param>
        /// <returns></returns>
        UserMode OnLine(UserToken ut);

        /// <summary>
        /// 角色下线
        /// </summary>
        /// <param name="ut"></param>
        void OffLine(UserToken ut);

        /// <summary>
        /// 根据角色ID得到链接
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        UserToken GetToken(int id);
    }
}
